<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<title>派工单管理</title>

<script type="text/javascript">

 var currentdispatchFormId="";

    function setCurrentdispatchFormId(id){
    currentdispatchFormId=id;
    }

	function refleshFrame(){

		var url = "${ctx}/customerService_dispatchFormAction.do?method=queryDispatchFormByPage&customerEventId=${customerEventId}";
		document.getElementById("customerDispatchFormList").src = url;
	}

	/**
	*增加派工单
	*/
	function addDispatchForm(result){

	var url = "${ctx}/customerService_dispatchFormAction.do?method=checkIsAllowAddDispatchForm&customerEventId=${customerEventId}";
	 new Ajax.Request(url,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var urll = "${ctx}/customerService_dispatchFormAction.do?method=navigateDispatchFormAdd&customerEventId=${customerEventId}";
		top.windowOpen(urll, "addDispatchForm", "创建派工单", 400, 650,true,"addDispatchForm");


		}}
	 );

	}


	/**
	*作废
	*/
	function disannulDispatchForm(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	  var urll = "${ctx}/customerService_dispatchFormAction.do?method=checkIsAllowSetAsideDispatchForm&dispatchFormId="+currentdispatchFormId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateDispatchFormDisannul&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "disannulDispatchForm", "作废", 270, 410,true,"disannulDispatchForm");


		}}
	 );

	}

	function dispatchFormDetail(){

	var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateDispatchFormDetail&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "dispatchFormDetail", "派工单详细信息", 550, 850,true,"dispatchFormDetail");

	}

	/**
	*接单登记
	*/
	function dispatchingAdd(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	   var urll = "${ctx}/customerService_dispatchFormAction.do?method=checkIsAllowDispatching&dispatchFormId="+currentdispatchFormId;
	 new Ajax.Request(urll,{method: 'post',onSuccess : function(result){
	 var resultText = result.responseText.strip();
		ajaxSubmitException(resultText);
		var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateReceiveDispatchForm&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "dispatchingAdd", "接单登记", 230, 550,true,"dispatchingAdd");


		}}
	 );


	}

	/**
	*费用清单
	*/
	function chargeItemManage(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	var url = "${ctx}/customerService_dispatchFormAction.do?method=navigateChargeItemManage&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "chargeItemManage", "费用清单", 350, 850,true,"chargeItemManage");

	}

	/**
	*费用核算
	*/
	function chargeCalculate(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	var url = "${ctx}/customerService_custServiceChargeAction.do?method=navigateChargeCalculateMain&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "chargeCalculate", "费用核算", 400, 900,true,"chargeCalculate");

	}

	/**
	*反馈管理
	*/
	function feedbackRecord(){
	if(currentdispatchFormId == "")
	  {
	   Alert('请选择一条记录!');
	   return false;
	  }
	var url = "${ctx}/customerService_feedbackRecordAction.do?method=navigateFeedbackRecordMain&dispatchFormId="+currentdispatchFormId;
		top.windowOpen(url, "feedbackRecord", "反馈管理", 460, 850,true,"feedbackRecord");

	}

	/**
	*派工单打印
	*/
	function showReport(){
		var url = "${ctx}/applets/appletShow.jsp?reportName=dispatchForm&dispatchFormId="+currentdispatchFormId;
	//	top.windowOpen(url, "showReport", "派工单",660,750,true,"showReport");
window.open (url);
	}


</script>
</head>

<body>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg">
    	<table border="0" cellpadding="0" cellspacing="0">
	      <tr>
	        <td><span class="window_head_intext"><img src="${ctx}/images/ico_Advance.gif" align="absmiddle" />&nbsp;派工单管理</span></td>
	      </tr>
    	</table>
    </td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
<tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td  class="content">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td bgcolor="#FFFFFF" border="0" cellspacing="0" cellpadding="0">
	        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BCBFD2" >
	          <tr>
	            <td>
  <table width="100%" border="0" cellpadding="0" cellspacing="0">

    <tr>
      <td class="bg_toolBar">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="35%">&nbsp;</td>
          <td width="65%" align="right"><!--------------------------右边图标01----------------------------------->
            <table border="0" cellpadding="0" cellspacing="0" id="ico1">
              <tr>
              <pms:AuthTag authName="customerService_dispatchFormAction.do?method=addDispatchForm">
                <td class="toolbarico"><a href="#" onClick="addDispatchForm();"onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新增派工单"/>&nbsp;</a></td>
                </pms:AuthTag>
                <pms:AuthTag authName="customerService_dispatchFormAction.do?method=disannulDispatchForm">
                <td class="toolbarico"><a href="#" onClick="disannulDispatchForm();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="作 废" width="16" height="16" border="0" align="absbottom" /></a></td>
              </pms:AuthTag>
              </tr>
            </table>
            <!--------------------------右边图标end----------------------------------->          </td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td valign="top">
		<iframe id="customerDispatchFormList"  name="customerDispatchFormList" height="300px" frameborder="0" border="0" src="${ctx}/customerService_dispatchFormAction.do?method=queryDispatchFormByPage&customerEventId=${customerEventId}" width="100%" ></iframe>
      </td>
    </tr>
  </table>

</td>
     </tr>
        </table></td>
    </tr>
  </table>

</td>
  </tr>
  <tr>
    <td colspan="2" class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
        <tr><td><table border="0"  cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
    </table>      </td>
	       <td class="btn_between_space"></td>

          <td class="btn_between_space"></td>
          <td>
          	<table border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td class="buttonOffLeft" id="btn1_31"></td>
                <td class="buttonOffMiddle"
                	id="btn1_32"
                	onClick="windowClose();"
                	onMouseOver="btn_change_over(3)"
                	onMouseOut="btn_change_out(3)"
                	onBlur="btn_change(3)">
                	<img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 关 闭</td>
                <td class="buttonOffRight" id="btn1_33"></td>
              </tr>
          </table></td>
        </tr>
          </table>
      <p>&nbsp;</p></td>
  </tr>
</table>
</div>
</body>
</html>
